473,424 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 software developers and data experts.

Load HTML into WebBrowser from C# form app?

Hi,

I'm creating a windows forms utility to create dhtml flyout menus. I want
to load the html and javascript generated into a webbrowser control, thats on
the form, so I can view the menus and view them in control.

I found there is no control in .net for this so I'm using the webbrowser
control.

How can you load the html directly into the control? Or do I have save the
file to disk first?

Thanks, Dave
Nov 16 '05 #1
2 13475
Hi Dave,

You can use the Microsoft Web Browser Control to show web pages.
Right click on the tool box, and select COM Componenents, and select the Web
Browser control.

HTH,
Rakesh Rajan

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.com...
Hi,

I'm creating a windows forms utility to create dhtml flyout menus. I want
to load the html and javascript generated into a webbrowser control, thats on the form, so I can view the menus and view them in control.

I found there is no control in .net for this so I'm using the webbrowser
control.

How can you load the html directly into the control? Or do I have save the
file to disk first?

Thanks, Dave

Nov 16 '05 #2
Dave,

You could do this, but it will require a good deal of interop (basically
it involves faking out the COM URL download system, creating an
implementation of IMoniker, and then calling the Load method on MSHTMLs
implementation of IPersistMoniker).

If you want to know the details, let me know, otherwise, I'd recommend
using a temp file. The advantage to my method is that you would be able to
tell MSHTML what the base URL to use is when resolving relative URLs.

Also, if your HTML is completely in memory and has no relative URLs,
then you can call the Load method on the implementation of IPersistMemory.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.com...
Hi,

I'm creating a windows forms utility to create dhtml flyout menus. I want
to load the html and javascript generated into a webbrowser control, thats
on
the form, so I can view the menus and view them in control.

I found there is no control in .net for this so I'm using the webbrowser
control.

How can you load the html directly into the control? Or do I have save the
file to disk first?

Thanks, Dave

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael C | last post by:
Anyone know of a good HTML Rendering control? I need a control that will render and display HTML in a Windows form. It doesn't need to pull down HTML pages from the Web - I'll feed it all the...
4
by: ALESSANDRO Baraldi | last post by:
Good evening. Few day ago i ask about this Object. A very kindly replay of Sthepen Lebans give me the solution to use ClipBoard to synthesise the Conversion, but i've some truble. My scene: ...
1
by: Risen | last post by:
Hi, all, How can I to load Html file that in memory stream to webBrowser instead to load Html file from disk. can anybody help me? Thx. B.R. Risen
5
by: Jesper | last post by:
Hi, Is there an alternative to an URI location when loading html into a webBrowser control. I have some html generated in a string. I would like to skip saving the string to a file on disk...
4
by: adwooley2 | last post by:
Can't seem to find anything that works for me. I have a small bit of HTML that is stored in a string variable. I want to assign this string to an mshtml object (IHTMLDocument2 I believe), so that...
4
by: Steve Richter | last post by:
I would like to build an HTML stream as a string and have the WebBrowser control render that HTML. Then on PostBack, or whatever it is called, I would like my code to be the one that receives what...
1
by: muralidhargvn | last post by:
Hi, I am writing an application in C# (.NET 1.1). I have AxWebBrowser control in my form. It will be loaded with a html page from the following location: /GA/Receive/Main.htm The loaded...
6
by: Neekos | last post by:
Im using VBA (in Access) to scrape an internal webpage at work to gather email addresses. The emails are encoded and i need to use this page to decode them. I can get it to return the entire HTML of...
7
by: ekimfeenux | last post by:
Hi there, I currently am trying to get HTML files to load into my WebBrowser control. These HTML files are saved on disk and I have a working OpenFileDialog control, but when I select the file it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.